/*           Copyright(c) 2005-2008 Dave Sexton            *
 *                   HtmlEditor Control                    *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using mshtml;
using System.Windows.Forms;

namespace DaveSexton.Controls
{
	/// <summary>
	/// Provides arguments for <see cref="HtmlEditor" /> events.
	/// </summary>
	public class HtmlEditorEventArgs : EventArgs
	{
		#region Public Properties
		public HtmlEvent Event
		{
			get
			{
				return @event;
			}
		}
		#endregion

		#region Private / Protected
		private readonly HtmlEvent @event;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="HtmlEditorEventArgs" /> class.
		/// </summary>
		public HtmlEditorEventArgs(HtmlEvent @event)
		{
			if (@event == null)
				throw new ArgumentNullException("event");

			this.@event = @event;
		}
		#endregion

		#region Methods
    public static HtmlEditorEventArgs FromEvent(HtmlDocument document, object htmlEvent)
		{
      return new HtmlEditorEventArgs(new HtmlEvent(document, (IHTMLEventObj) htmlEvent));
		}

    public static HtmlEditorEventArgs FromEvent(HtmlDocument document, object htmlEvent, HtmlElementEventArgs baseArgs)
		{
      return new HtmlEditorEventArgs(new HtmlEvent(document, (IHTMLEventObj) htmlEvent, baseArgs));
		}

    internal static HtmlEditorEventArgs FromEvent(HtmlDocument document, IHTMLEventObj htmlEvent, HtmlElementEventArgs baseArgs)
		{
      return new HtmlEditorEventArgs(new HtmlEvent(document, htmlEvent, baseArgs));
		}

    internal static HtmlEditorEventArgs FromEvent(HtmlDocument document, IHTMLEventObj htmlEvent)
		{
      return new HtmlEditorEventArgs(new HtmlEvent(document, htmlEvent));
		}
		#endregion
	}
}
